<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-sclae=1.0,user-scalable=0">
	<link rel="stylesheet" type="text/css" href="css/base.css">
	<title>xuluo</title>
	<style type="text/css">
		li{border-bottom: 1px solid #ccc;text-align: center;padding: 10px 0;}
	</style>
</head>
<body>
	<ul id="ul">
		<li>1111111111</li>
		<li>2222222222</li>
		<li>3333333333</li>
	</ul>
	<script type="text/javascript">
		if(!Array.prototype.forEach){
			Array.prototype.forEach=function(fun){
				for(var i=0;i<this.length;i++){
					if (i in this)
            		fun.call(null,this[i], i, this);
				}
			};
		}
		[].forEach.call(document.getElementsByTagName('li'),function(e,i){
			e.onclick=function(){
				alert(i);
			};
		});
	</script>
</body>
</html>